﻿using Exceptionless;
using Microsoft.Extensions.Configuration;
using System;

namespace ExceptionlessDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            var setttins = new ConfigurationBuilder().AddJsonFile("appsetting.json").Build();
            string url = setttins.GetSection("url").Value?? "http://124.71.199.73:6300/";
            string apikey = setttins.GetSection("apikey").Value?? "R3X5tZddtYf96QDvshVpLdqATPAObMGDYCPqxC7m";
            Console.WriteLine(url);
            Console.WriteLine(apikey); 

            ExceptionlessClient.Default.Configuration.ServerUrl = url; 
            ExceptionlessClient.Default.Startup(apikey);
            
            try
            {
                int i = 1;
                int y = 0;
                int x = i / y;
            }
            catch (Exception ex)
            {
                ex.ToExceptionless().Submit();
            }
            Console.WriteLine("发送完成！！!");
        }
    }
}
